﻿<%@ Page Title="发布新询盘" Language="C#" MasterPageFile="~/masterPage/admin/Purchase.master"
    AutoEventWireup="true" CodeFile="PurchNewInquery.aspx.cs" Inherits="Trade_trade_item" %>

<%@ MasterType VirtualPath="~/masterPage/admin/Purchase.master" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rtvCategoryTree">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rtvCategoryTree"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="radgridSelectedCategory" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="radgridSelectedCategory">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radgridSelectedCategory"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="dvAddress">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="dvAddress"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="gvAddressList" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="SelectedDeliveryAddress"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="gvAddressList">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gvAddressList"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="dvAddress" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID=" "></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rblPublic">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rblPublic"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="pnlVendorSelection" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>





            <telerik:AjaxSetting AjaxControlID="ddlType">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlType"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="rtvCategoryTree" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>

            <telerik:AjaxSetting AjaxControlID="ddlSellerRoot">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlSellerRoot"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="radgridVendorList" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>





            
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadCodeBlock runat="Server" ID="RadCodeBlock1">
        <script type="text/javascript">
            
        //<![CDATA[
            function isOverElement(currentElement, targetId) {
                while (currentElement) {
                    if (currentElement.id == targetId)
                        return currentElement;

                    currentElement = currentElement.parentNode;
                }

                return null;
            }

            function onDropping(sender, args) {
                var destNode = args.get_destNode();
                var destElement = args.get_htmlElement();

                if (destNode) return;

                if (!destElement) return;
                var grid = isOverElement(destElement, "<%=radgridSelectedCategory.ClientID %>");

                if (grid) {
                    args.set_htmlElement(grid);
                    return;
                }

                args.set_cancel(true);
            }
            

            //]]>
            function validateDrawing(source, arguments) {
                arguments.IsValid = getRadUpload('<%= radUploadDrawing.ClientID %>').validateExtensions();
            }

            function change(sender, args) {
                var value = args.get_item().get_value();
                if (sender == $find("<%= ddlType.ClientID %>")) {
                    var panel = $find("<%=rtvCategoryTree.DataSourceID %>");
                    panel = "xdsWareCubes";
                }
            }
        </script>
    </telerik:RadCodeBlock>
    <table width="800px">
        <tr>
            <td>
                &nbsp;<asp:Button ID="btSubmit" runat="server" Text="提交" OnClick="btSubmit_Click" />
            </td>
        </tr>
    </table>
    <table cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td valign="top" align="right">
                <telerik:RadTabStrip ID="rtsTradeItem" runat="server" SelectedIndex="0" MultiPageID="rmpTradeItem"
                    Orientation="VerticalLeft">
                    <Tabs>
                        <telerik:RadTab Text="基本信息" PageViewID="RadPageView1">
                        </telerik:RadTab>
                        <telerik:RadTab Text="货物运输" PageViewID="RadPageView3">
                        </telerik:RadTab>
                        <telerik:RadTab Text="附加信息" PageViewID="RadPageView4">
                        </telerik:RadTab>
                        <telerik:RadTab Text="供应商" SelectedIndex="0">
                            <Tabs>
                                <telerik:RadTab Text="供应商检索" PageViewID="RadPageView8">
                                </telerik:RadTab>
                                <telerik:RadTab Text="按地区匹配" PageViewID="RadPageView9">
                                </telerik:RadTab>
                            </Tabs>
                        </telerik:RadTab>
                        <telerik:RadTab Text="采购商信息" PageViewID="RadPageView5">
                        </telerik:RadTab>
                    </Tabs>
                </telerik:RadTabStrip>
                <br />
                <table width="80">
                    <tr>
                        <td>
                            <asp:Label ID="lblMsg" runat="server" EnableViewState="false" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                </table>
            </td>
            <td>
                <telerik:RadMultiPage ID="rmpTradeItem" runat="server" SelectedIndex="0">
                    <telerik:RadPageView ID="RadPageView1" runat="server">
                        <div>
                            <table>
                                <tr>
                                    <td>
                                        <fieldset>
                                            <legend>技术细节</legend>
                                            <br />
                                            <table>
                                                <tr>
                                                    <td>
                                                        <span class="required">*</span>采购类型
                                                    </td>
                                                    <td>

                                                        <asp:DropDownList ID="ddlType" runat="server"     OnSelectedIndexChanged="change" AutoPostBack="true">
                                                            <asp:ListItem Text="通用部件/标准件采购" Selected="True" Value="1"></asp:ListItem>
                                                            <asp:ListItem Text="图纸加工" Value="2"></asp:ListItem>
                                                        </asp:DropDownList>
                                                        <%--<telerik:RadComboBox ID="ddlType" runat="server"  OnSelectedIndexChanged="change">
                                                            <Items>
                                                                <telerik:RadComboBoxItem Text="通用部件/标准件采购" Value="1" Selected="True" />
                                                                <telerik:RadComboBoxItem Text="图纸加工" Value="2" />
                                                            </Items>
                                                        </telerik:RadComboBox>--%>
                                                    </td>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                    <td>
                                                        <span class="required">*</span>零部件名称
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="tbName" MaxLength="100" runat="server"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="tbName"
                                                            ErrorMessage="请输入零部件名"></asp:RequiredFieldValidator>
                                                    </td>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <span class="required">*</span>加工工艺类别
                                                    </td>
                                                    <td colspan="2">
                                                        <telerik:RadTreeView runat="Server" ID="rtvCategoryTree" CausesValidation="false"
                                                            EnableDragAndDrop="true" OnClientNodeDropping="onDropping" EnableDragAndDropBetweenNodes="false"
                                                              LoadingMessage="加载中 ..." DataTextField="title" DataValueField="key"
                                                            OnNodeDrop="rtvCategoryTree_NodeDrop">
                                                            <DataBindings>
                                                                <telerik:RadTreeNodeBinding Expanded="false" ExpandMode="ServerSideCallBack" AllowDragField="drag" />
                                                            </DataBindings>
                                                        </telerik:RadTreeView>
                                                        <%--<telerik:RadTreeView runat="Server" ID="rtvCategoryTree" CausesValidation="false" EnableDragAndDrop="true" OnClientNodeDropping="onDropping"
                            EnableDragAndDropBetweenNodes="false" LoadingMessage="加载中 ...">
                    <Nodes>
                        <telerik:RadTreeNode runat="server" Text="零部件库" Value="island" Expanded="true" AllowDrag="false"
                            AllowDrop="false">
                            <Nodes>
                                <telerik:RadTreeNode runat="server" Expanded="true" Text="机械系统通用零部件" Value="子类1" AllowDrag="false" AllowDrop="false">
                                    <Nodes>
                                        <telerik:RadTreeNode runat="server" Text="紧固件" AllowDrop="false" Value="">
                                        </telerik:RadTreeNode>
                                        <telerik:RadTreeNode runat="server" Text="轴承" AllowDrop="false" Value="">
                                        </telerik:RadTreeNode>
                                        <telerik:RadTreeNode runat="server" Text="轴承座" AllowDrop="false" Value="">
                                        </telerik:RadTreeNode>
                                    </Nodes>
                                </telerik:RadTreeNode>
                                <telerik:RadTreeNode runat="server" Text="电子电气系统零部件" Value="子类2" AllowDrag="false" AllowDrop="false">
                                    <Nodes>
                                        <telerik:RadTreeNode runat="server" Text="通用部件" AllowDrop="false" Value="">
                                        </telerik:RadTreeNode>
                                        <telerik:RadTreeNode runat="server" Text="线缆" AllowDrop="false" Value="">
                                        </telerik:RadTreeNode>
                                        <telerik:RadTreeNode runat="server" Text="插座" AllowDrop="false" Value="">
                                        </telerik:RadTreeNode>
                                    </Nodes>
                                </telerik:RadTreeNode>
                            </Nodes>
                        </telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeView>--%>
                                                    </td>
                                                    <td colspan="2">
                                                        <telerik:RadGrid ID="radgridSelectedCategory" runat="server" Width="300" AutoGenerateColumns="false"
                                                            OnDeleteCommand="radgridSelectedCategory_DeleteCommand" OnItemCommand="radgridSelectedCategory_ItemCommand">
                                                            <MasterTableView ShowHeadersWhenNoRecords="true" ShowFooter="true">
                                                                <NoRecordsTemplate>
                                                                    请拖动您选择的类别到这里...
                                                                </NoRecordsTemplate>
                                                                <Columns>
                                                                    <telerik:GridBoundColumn DataField="Text" HeaderText="您的自选类别" UniqueName="Text">
                                                                    </telerik:GridBoundColumn>
                                                                    <telerik:GridBoundColumn DataField="Value" HeaderText="类别代码" UniqueName="Value">
                                                                    </telerik:GridBoundColumn>
                                                                    <telerik:GridButtonColumn CommandName="Delete" ButtonType="ImageButton" ConfirmText="您确认要移除该类别么"
                                                                        UniqueName="delete" ImageUrl="~/images/deleteicon.png">
                                                                    </telerik:GridButtonColumn>
                                                                </Columns>
                                                            </MasterTableView>
                                                        </telerik:RadGrid>
                                                    </td>
                                                    <td>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        零部件编号
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="tbNumber" MaxLength="100" runat="server"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                    <td>
                                                        零部件模型/图纸
                                                    </td>
                                                    <td>
                                                        <telerik:RadUpload ID="radUploadDrawing" runat="server" MaxFileInputsCount="1" ToolTip="文件最大不可超过5MB"
                                                            TargetFolder="~/Temporary/uploads/dwg" AllowedFileExtensions=".dwf,.prt,.stl"
                                                            MaxFileSize="5120000" ReadOnlyFileInputs="true" ControlObjectsVisibility="ClearButtons"
                                                            Culture="zh-CN" Width="200px" Enabled="True">
                                                            <Localization Select="浏览" />
                                                            <Localization Clear="清空" />
                                                        </telerik:RadUpload>
                                                        <font style="color: Blue">*可输入的格式为（.dwf,.prt,.stl）</font><%-- ning    注释信息方便用户操作--%></td>
                                                    <td>
                                                        <asp:CustomValidator ID="Customvalidator1" runat="server" Display="Dynamic" ClientValidationFunction="validateDrawing">
                            <span style="color:Red">无效的文件格式</span>
                                                        </asp:CustomValidator>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        零部件材料
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="tbMaterial" MaxLength="50" runat="server"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                    <td>
                                                        零部件用途
                                                    </td>
                                                    <td>
                                                        &nbsp;
                                                        <asp:TextBox ID="tbWhereused" MaxLength="50" runat="server"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        说明
                                                    </td>
                                                    <td colspan="4">
                                                        <asp:TextBox ID="tbDescription" MaxLength="250" runat="server" TextMode="MultiLine"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                            </table>
                                        </fieldset>
                                        <br />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <fieldset>
                                            <legend>商务细节</legend>
                                            <br />
                                            <table border="1">
                                                <colgroup>
                                                    <col width="80" />
                                                    <col width="150" />
                                                    <col width="100" />
                                                    <col width="10" />
                                                    <col width="120" />
                                                    <col width="280" />
                                                </colgroup>
                                                <tr>
                                                    <td>
                                                        <span class="required">*</span>报价数量1
                                                    </td>
                                                    <td>
                                                        <telerik:RadNumericTextBox ID="rntbQty1" runat="server" ToolTip="最大数量为一百万" Type="Number"
                                                            NumberFormat-KeepNotRoundedValue="true" NumberFormat-AllowRounding="false" NumberFormat-DecimalDigits="0">
                                                        </telerik:RadNumericTextBox>
                                                    </td>
                                                    <td>
                                                        <asp:RequiredFieldValidator ID="NumercTextBoxRequiredFieldValidator" runat="server"
                                                            Display="Dynamic" ControlToValidate="rntbQty1" ErrorMessage="请输入报价数量" />
                                                        <asp:RangeValidator ID="NumericTextBoxRangeValidator" runat="server" ControlToValidate="rntbQty1"
                                                            ErrorMessage="数值超出范围" Display="Dynamic" MaximumValue="1000000" MinimumValue="0"
                                                            Type="Double" />
                                                    </td>
                                                    <td>
                                                        &nbsp;&nbsp;
                                                    </td>
                                                    <td>
                                                        <span class="required">*</span>报价截止日期
                                                    </td>
                                                    <td>
                                                        <telerik:RadDatePicker ID="rdpExpDate" runat="server" EnableTyping="false" SharedCalendarID="sharedCalendar"
                                                            DateInput-ToolTip="请点击右侧日历选择日期" DatePopupButton-ToolTip="点击这里选择日期">
                                                        </telerik:RadDatePicker>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="请选择报价截止日"
                                                            ControlToValidate="rdpExpDate"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <span class="required">*</span>报价数量2
                                                    </td>
                                                    <td>
                                                        <telerik:RadNumericTextBox ID="rntbQty2" runat="server" ToolTip="最大数量为一百万" Type="Number"
                                                            NumberFormat-KeepNotRoundedValue="true" NumberFormat-AllowRounding="false" NumberFormat-DecimalDigits="0">
                                                        </telerik:RadNumericTextBox>
                                                    </td>
                                                    <td>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="Dynamic"
                                                            ControlToValidate="rntbQty2" ErrorMessage="请输入报价数量" />
                                                        <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="rntbQty2"
                                                            ErrorMessage="数值超出范围" Display="Dynamic" MaximumValue="1000000" MinimumValue="0"
                                                            Type="Double" />
                                                    </td>
                                                    <td>
                                                        &nbsp;&nbsp;
                                                    </td>
                                                    <td>
                                                        <span class="required">*</span>授盘预定日期
                                                    </td>
                                                    <td>
                                                        <telerik:RadDatePicker ID="rdpAssignDate" runat="server" EnableTyping="false" SharedCalendarID="sharedCalendar"
                                                            DateInput-ToolTip="请点击右侧日历选择日期" DatePopupButton-ToolTip="点击这里选择日期">
                                                        </telerik:RadDatePicker>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="请选择授盘预定日"
                                                            ControlToValidate="rdpAssignDate"></asp:RequiredFieldValidator>
                                                        <telerik:RadCalendar ID="sharedCalendar" runat="server" EnableMultiSelect="false"
                                                            RangeMinDate="2006/01/01" CultureInfo="zh-CN">
                                                        </telerik:RadCalendar>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <span class="required">*</span>报价数量3
                                                    </td>
                                                    <td>
                                                        <telerik:RadNumericTextBox ID="rntbQty3" runat="server" ToolTip="最大数量为一百万" Type="Number"
                                                            NumberFormat-KeepNotRoundedValue="true" NumberFormat-AllowRounding="false" NumberFormat-DecimalDigits="0">
                                                        </telerik:RadNumericTextBox>
                                                    </td>
                                                    <td>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" Display="Dynamic"
                                                            ControlToValidate="rntbQty3" ErrorMessage="请输入报价数量" />
                                                        <asp:RangeValidator ID="RangeValidator2" runat="server" ControlToValidate="rntbQty3"
                                                            ErrorMessage="数值超出范围" Display="Dynamic" MaximumValue="1000000" MinimumValue="0"
                                                            Type="Double" />
                                                    </td>
                                                    <td>
                                                        &nbsp;&nbsp;
                                                    </td>
                                                    <td>
                                                        <span class="required">*</span>交货期限
                                                    </td>
                                                    <td>
                                                        <telerik:RadDatePicker ID="rdpDelivery" runat="server" EnableTyping="false" SharedCalendarID="sharedCalendar"
                                                            DateInput-ToolTip="请点击右侧日历选择日期" DatePopupButton-ToolTip="点击这里选择日期">
                                                        </telerik:RadDatePicker>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="请选择交货期限"
                                                            ControlToValidate="rdpDelivery"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        预付金额
                                                    </td>
                                                    <td>
                                                        <telerik:RadNumericTextBox ID="rntbPrepaid" runat="server" Width="50" Type="Percent"
                                                            ShowSpinButtons="true" Value="30" Culture="zh-CN">
                                                            <NumberFormat DecimalDigits="0" AllowRounding="true" KeepNotRoundedValue="false" />
                                                        </telerik:RadNumericTextBox>
                                                        总额
                                                    </td>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                    <td>
                                                        <span class="required">*</span>付款方式
                                                    </td>
                                                    <td>
                                                        <asp:RadioButtonList ID="rblPayMethod" runat="server" RepeatDirection="Horizontal">
                                                            <asp:ListItem Text="现金支票" Value="现金支票" Selected="True"></asp:ListItem>
                                                            <asp:ListItem Text="银行转帐" Value="银行转帐"></asp:ListItem>
                                                            <asp:ListItem Text="电汇" Value="电汇"></asp:ListItem>
                                                            <asp:ListItem Text="其他" Value="其他"></asp:ListItem>
                                                        </asp:RadioButtonList>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        采购单位
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlUnit" runat="server">
                                                            <asp:ListItem Text="件" Value="件" Selected="True"></asp:ListItem>
                                                            <asp:ListItem Text="千件" Value="千件"></asp:ListItem>
                                                            <asp:ListItem Text="套" Value="套"></asp:ListItem>
                                                            <asp:ListItem Text="米" Value="米"></asp:ListItem>
                                                            <asp:ListItem Text="千克" Value="千克"></asp:ListItem>
                                                            <asp:ListItem Text="吨" Value="吨"></asp:ListItem>
                                                            <asp:ListItem Text="英尺" Value="英尺"></asp:ListItem>
                                                            <asp:ListItem Text="英寸" Value="英寸"></asp:ListItem>
                                                        </asp:DropDownList>
                                                    </td>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                    <td>
                                                        报价币种
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="ddlCurrency" runat="server">
                                                            <asp:ListItem Value="CNY" Text="CNY 人民币" Selected="True"></asp:ListItem>
                                                            <asp:ListItem Value="USD" Text="USD 美元"></asp:ListItem>
                                                            <asp:ListItem Value="GBP" Text="GBP 英镑"></asp:ListItem>
                                                            <asp:ListItem Value="HKD" Text="HKD 港币"></asp:ListItem>
                                                            <asp:ListItem Value="EUR" Text="EUR 欧元"></asp:ListItem>
                                                            <asp:ListItem Value="JPY" Text="JPY 日元"></asp:ListItem>
                                                            <asp:ListItem Value="KER" Text="KER 韩元"></asp:ListItem>
                                                            <asp:ListItem Value="TWD" Text="TWD 台币"></asp:ListItem>
                                                            <asp:ListItem Value="SGD" Text="SGD 新加坡元"></asp:ListItem>
                                                            <asp:ListItem Value="CAD" Text="CAD 加元"></asp:ListItem>
                                                            <asp:ListItem Value="AUD" Text="AUD 澳元"></asp:ListItem>
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>
                                            </table>
                                        </fieldset>
                                        <br />
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="RadPageView3" runat="server" Width="100%">
                        
                        <table>
                            <tr>
                                <td>
                                    运输费用责任方
                                </td>
                                <td>
                                    &nbsp;
                                    <asp:RadioButtonList ID="rblDelivery" runat="server" RepeatDirection="Horizontal">
                                        <asp:ListItem Text="采购商负责" Value="1"></asp:ListItem>
                                        <asp:ListItem Text="供应商报价" Value="2" Selected="True"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;<asp:HiddenField ID="SelectedDeliveryAddress" runat="server" OnLoad="SelectedDeliveryAddress_Load" />
                                    <asp:Literal ID="SelectedDelivAddrSave" runat="server" Visible="false"></asp:Literal>
                                </td>
                                <td>
                                    <asp:DetailsView ID="dvAddress" runat="server" AutoGenerateRows="false" DataSourceID="odsAddressView"
                                        Height="50px" Width="500px" DefaultMode="ReadOnly" OnItemCreated="dvAddress_ItemCreated"
                                        OnItemInserted="dvAddress_ItemInserted" OnItemInserting="dvAddress_ItemInserting">
                                        <Fields>
                                            <asp:TemplateField HeaderText="收货人姓名" SortExpression="Contact" HeaderStyle-Width="80px">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="tbContact" runat="server" Text='<%# Bind("Contact") %>'></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbContact"
                                                        ErrorMessage="必填" ValidationGroup="IVC"></asp:RequiredFieldValidator>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="lbtContact" runat="server" Text='<%# Bind("Contact") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="所在地区">
                                                <InsertItemTemplate>
                                                    <telerik:RadComboBox ID="rcbCountry" runat="server" AllowCustomText="false" Width="120px">
                                                        <Items>
                                                            <telerik:RadComboBoxItem runat="server" Text="中国" Value="CHN" Selected="true" />
                                                        </Items>
                                                    </telerik:RadComboBox>
                                                    <telerik:RadComboBox ID="rcbProvince" runat="server" Width="120px" AllowCustomText="false"
                                                        AutoPostBack="true" OnSelectedIndexChanged="rcbProvince_SelectedIndexChanged">
                                                    </telerik:RadComboBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="rcbProvince"
                                                        ErrorMessage="必填" ValidationGroup="IVC"></asp:RequiredFieldValidator>
                                                    <telerik:RadComboBox ID="rcbCity" runat="server" Width="120px" AllowCustomText="false">
                                                    </telerik:RadComboBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="rcbCity"
                                                        ErrorMessage="必填" ValidationGroup="IVC"></asp:RequiredFieldValidator>
                                                </InsertItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Literal ID="ltlCountry" Text='<%# String.Format("{0} {1} {2}", Eval("Country"), Eval("Province"), Eval("City")) %>'
                                                        runat="server"></asp:Literal>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="街道地址" SortExpression="Street">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="tbStreet" runat="server" Text='<%# Bind("Street") %>'></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="tbStreet"
                                                        ErrorMessage="必填" ValidationGroup="IVC"></asp:RequiredFieldValidator>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="lbtbStreet" runat="server" Text='<%# Bind("Street") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="邮政编码" SortExpression="Postcode">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="tbPostcode" runat="server" Text='<%# Bind("Postcode") %>'></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="tbPostcode"
                                                        ErrorMessage="必填" ValidationGroup="IVC"></asp:RequiredFieldValidator>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="lbtPostcode" runat="server" Text='<%# Bind("Postcode") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="电话号码" SortExpression="Phone">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="tbPhone" runat="server" Text='<%# Bind("Phone") %>'></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="tbPhone"
                                                        ErrorMessage="必填" ValidationGroup="IVC"></asp:RequiredFieldValidator>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="lbtPhone" runat="server" Text='<%# Bind("Phone") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="手机号码" SortExpression="CellPhone">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="tbCellPhone" runat="server" Text='<%# Bind("CellPhone") %>'></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="tbCellPhone"
                                                        ErrorMessage="必填" ValidationGroup="IVC"></asp:RequiredFieldValidator>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="lbtCellPhone" runat="server" Text='<%# Bind("CellPhone") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:CheckBoxField HeaderText="默认地址？" DataField="isDefault" />
                                            <asp:TemplateField>
                                                <InsertItemTemplate>
                                                    <asp:HiddenField ID="HiddenField1" Value='<%# Bind("CreateDate") %>' runat="server" />
                                                </InsertItemTemplate>
                                            </asp:TemplateField>
                                            <asp:CommandField ShowInsertButton="true" ShowCancelButton="true" InsertText="确定"
                                                NewText="新建地址" CancelText="取消" ValidationGroup="IVC" />
                                        </Fields>
                                    </asp:DetailsView>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    收货地址
                                </td>
                                <td>
                                    <asp:GridView ID="gvAddressList" runat="server" DataSourceID="odsAddressList" AutoGenerateColumns="False"
                                        DataKeyNames="AddressID" OnRowDataBound="gvAddressList_RowDataBound" OnSelectedIndexChanged="gvAddressList_SelectedIndexChanged">
                                        <RowStyle HorizontalAlign="Center" />
                                        <SelectedRowStyle BackColor="#a7d2e9" />
                                        <Columns>
                                            <asp:BoundField DataField="AddressID" HeaderText="标识" ReadOnly="True" Visible="False" />
                                            <asp:BoundField DataField="Contact" HeaderText="收货人">
                                                <HeaderStyle HorizontalAlign="Center" Width="60px" Wrap="False" />
                                            </asp:BoundField>
                                            <asp:TemplateField HeaderText="所在地区">
                                                <HeaderStyle Width="120px" HorizontalAlign="Center" Wrap="False" />
                                                <ItemTemplate>
                                                    <asp:Literal ID="Literal2" Text='<%# String.Format("{0} {1} {2}", Eval("Country"), Eval("Province"), Eval("City")) %>'
                                                        runat="server"></asp:Literal>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="电话/手机">
                                                <HeaderStyle HorizontalAlign="Center" Width="120px" />
                                                <ItemTemplate>
                                                    <asp:Literal ID="Literal1" Text='<%# String.Format("{0}", Eval("CellPhone")) %>'
                                                        runat="server"></asp:Literal>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:CommandField ShowSelectButton="True" SelectText="选择" />
                                        </Columns>
                                    </asp:GridView>
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    运送说明
                                </td>
                                <td>
                                    &nbsp;
                                    <asp:TextBox ID="tbDelvryComment" runat="server" TextMode="MultiLine"></asp:TextBox>
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                        </table>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="RadPageView4" runat="server" Width="100%">
                        <table>
                            <tr>
                                <td>
                                    <fieldset>
                                        <legend>零件图片</legend>
                                        <br />
                                        <telerik:RadUpload ID="radUploadImage" runat="server" MaxFileInputsCount="1" TargetFolder="~/Temporary/uploads/img"
                                            AllowedFileExtensions=".bmp,.jpg,.png,.jpeg,.rar" MaxFileSize="5120000" ReadOnlyFileInputs="true"
                                            ControlObjectsVisibility="ClearButtons" Culture="zh-CN">
                                            <Localization Select="浏览" />
                                            <Localization Clear="清空" />
                                        </telerik:RadUpload>
                                        <font style="color: blue">*可输入的格式为（.bmp,.jpg,.png,.jpeg,.rar）</font><%-- ning 同上--%></fieldset>
                                    <br />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <fieldset>
                                        <legend>附件上传</legend>
                                        <telerik:RadUpload ID="radUploadAttachment" runat="server" MaxFileInputsCount="1"
                                            TargetFolder="~/Temporary/uploads/com" AllowedFileExtensions=".rar,.zip,.doc,.pdf,.docx,.ppt,.xls"
                                            MaxFileSize="5120000" ReadOnlyFileInputs="true" ControlObjectsVisibility="ClearButtons"
                                            Culture="zh-CN">
                                            <Localization Select="浏览" />
                                            <Localization Clear="清空" />
                                        </telerik:RadUpload>
                                        <font style="color: Blue">*可输入的格式为（.rar,.zip,.doc,.pdf,.docx,.ppt,.xls）<%--ning  同上--%><br /></font><telerik:RadTextBox ID="tbAtchComment" runat="server" TextMode="MultiLine" MaxLength="250"
                                            EmptyMessage="请输入附件说明">
                                        </telerik:RadTextBox>
                                        <br />
                                    </fieldset>
                                    <br />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <fieldset>
                                        <legend>其他</legend>
                                        <br />
                                        <table>
                                            <tr>
                                                <td>
                                                    预计年采购量
                                                </td>
                                                <td>
                                                    <telerik:RadNumericTextBox ID="rntbRefVolum" runat="server">
                                                    </telerik:RadNumericTextBox>
                                                </td>
                                                <td>
                                                    &nbsp;
                                                </td>
                                                <td>
                                                    参考价格
                                                </td>
                                                <td>
                                                    <telerik:RadNumericTextBox ID="rntbRefPrice" runat="server">
                                                    </telerik:RadNumericTextBox>
                                                </td>
                                                <td>
                                                    &nbsp;
                                                </td>
                                                <td>
                                                    询价目的
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="tbPurpose" MaxLength="50" runat="server"></asp:TextBox>
                                                </td>
                                                <td>
                                                    &nbsp;
                                                </td>
                                            </tr>
                                        </table>
                                    </fieldset>
                                    <br />
                                </td>
                            </tr>
                        </table>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="RadPageView8" runat="server" Width="100%">
                        <asp:RadioButtonList ID="rblPublic" runat="server" RepeatDirection="Horizontal" AutoPostBack="true"
                            OnSelectedIndexChanged="rblPublic_SelectedIndexChanged">
                            <asp:ListItem Text="公开询盘" Value="1" Selected="True"></asp:ListItem>
                            <asp:ListItem Text="指定供应商" Value="0"></asp:ListItem>
                        </asp:RadioButtonList>
                        <asp:Panel ID="pnlVendorSelection" Enabled="false" runat="server" BorderStyle="None"
                            HorizontalAlign="Left">
                            <table>
                                <tr>
                                    <td colspan="2">
                                        <asp:DropDownList ID="ddlSellerRoot" runat="server" 
                                            onselectedindexchanged="ddlSellerRoot_SelectedIndexChanged" AutoPostBack="true">
                                            <asp:ListItem  Text="我的供应商库" Value="own" Selected="True"></asp:ListItem>
                                            <asp:ListItem Text="所有供应商" Value="all"> </asp:ListItem>
                                        </asp:DropDownList>
                                        <telerik:RadTextBox ID="rtbFindSeller" runat="server" EmptyMessage="输入检索内容">
                                        </telerik:RadTextBox>
                                        <asp:Button ID="btFindSeller" runat="server" Text="搜索" />
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td valign="top">
                                        <telerik:RadGrid ID="radgridVendorList" runat="server" Width="300" AutoGenerateColumns="false"
                                              AllowMultiRowSelection="true">
                                            <PagerStyle FirstPageToolTip="首页" ShowPagerText="false" PagerTextFormat="{4}  当前{0}/{1}页, 条目({2}-{3})/{5}"
                                                  NextPagesToolTip="下页" Mode="NextPrevAndNumeric" PageSizeLabelText="单页数目" PrevPageToolTip="上页"
                                                LastPageToolTip="末页" />
                                            <MasterTableView AllowPaging="true" PageSize="10" AutoGenerateColumns="False" DataKeyNames="CompanyID,CompanyName"
                                                 ShowHeadersWhenNoRecords="true" ShowFooter="true">
                                            
                                                <NoRecordsTemplate>
                                                    暂时无供应商可供选择...
                                                </NoRecordsTemplate>
                                                <Columns>
                                                    <telerik:GridClientSelectColumn UniqueName="column" EditFormHeaderTextFormat="{0}:">
                                                        <HeaderStyle Width="30px" />
                                                    </telerik:GridClientSelectColumn>
                                                    <telerik:GridBoundColumn DataField="CompanyName" HeaderText="供应商名称" UniqueName="Text"
                                                        CurrentFilterFunction="NotBetween" EditFormHeaderTextFormat="{1}:">
                                                    </telerik:GridBoundColumn>
                                                </Columns>
                                            </MasterTableView>
                                            <ClientSettings>
                                                <Selecting AllowRowSelect="true" UseClientSelectColumnOnly="true" />
                                                
                                            </ClientSettings>
                                        </telerik:RadGrid>
                                    </td>
                                    <td valign="middle">
                                        <asp:Button ID="btnTargetVendor" runat="server" Text="->" CausesValidation="false"
                                            OnClick="btnTargetVendor_Click" />
                                    </td>
                                    <td valign="top">
                                        <telerik:RadGrid ID="rgridTargetVendors" runat="server" Width="300" AutoGenerateColumns="false"
                                            OnDeleteCommand="rgridTargetVendors_DeleteCommand" OnItemCommand="rgridTargetVendors_ItemCommand">
                                            <PagerStyle FirstPageToolTip="首页" ShowPagerText="false" PagerTextFormat="{4}  当前{0}/{1}页, 条目({2}-{3})/{5}"
                                                NextPagesToolTip="下页" Mode="NextPrevAndNumeric" PageSizeLabelText="单页数目" PrevPageToolTip="上页"
                                                LastPageToolTip="末页" />
                                            <MasterTableView AllowPaging="true" PageSize="10" AutoGenerateColumns="False" DataKeyNames="CompanyID, CompanyName"
                                                TableLayout="Fixed" ShowHeadersWhenNoRecords="true" ShowFooter="true">
                                                <NoRecordsTemplate>
                                                    尚未选择供应商...
                                                </NoRecordsTemplate>
                                                <Columns>
                                                    <telerik:GridBoundColumn DataField="CompanyName" HeaderText="已选择的供应商" UniqueName="Text">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridButtonColumn CommandName="Delete" ButtonType="ImageButton" ConfirmText="确定要移除该供应商么?!"
                                                        UniqueName="DeleteCol" ImageUrl="~/images/deleteicon.png">
                                                        <HeaderStyle Width="30px" />
                                                    </telerik:GridButtonColumn>
                                                </Columns>
                                            </MasterTableView>
                                        </telerik:RadGrid>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="RadPageView9" runat="server" Width="100%">
                        <asp:CheckBoxList ID="cblProcity" runat="server">
                            <asp:ListItem Text="上海" Value="上海" Selected="True"></asp:ListItem>
                            <asp:ListItem Text="北京" Value="北京"></asp:ListItem>
                            <asp:ListItem Text="浙江" Value="浙江"></asp:ListItem>
                            <asp:ListItem Text="深圳" Value="深圳"></asp:ListItem>
                            <asp:ListItem Text="东莞" Value="东莞"></asp:ListItem>
                        </asp:CheckBoxList>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="RadPageView5" runat="server" Width="100%">
                        <asp:DetailsView ID="dvBuyer" runat="server" Height="50px" Width="125px" AutoGenerateRows="False">
                            <FieldHeaderStyle CssClass="contentHeader" />
                            <RowStyle CssClass="contentRow" />
                            <Fields>
                                <asp:BoundField DataField="CompanyName" ShowHeader="true" ReadOnly="true" HeaderText="公司名称" />
                                <asp:BoundField DataField="Website" ShowHeader="true" ReadOnly="true" HeaderText="网站" />
                                <asp:BoundField DataField="Province" ShowHeader="true" ReadOnly="true" HeaderText="所在省份" />
                                <asp:BoundField DataField="City" ShowHeader="true" ReadOnly="true" HeaderText="所在城市" />
                            </Fields>
                        </asp:DetailsView>
                    </telerik:RadPageView>
                </telerik:RadMultiPage>
            </td>
        </tr>
    </table>
    <table>
        <tr>
            <td>
            </td>
        </tr>
    </table>
    <asp:ObjectDataSource ID="odsAddressView" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="SelectSingle" TypeName="SalePartial.BLL.XPDeliveryAddres" InsertMethod="Insert">
        <SelectParameters>
            <asp:ControlParameter ControlID="SelectedDeliveryAddress" DbType="Guid" Name="AddressID"
                PropertyName="Value" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter DbType="Guid" Name="AddressID" />
            <asp:Parameter DbType="Guid" Name="CompanyID" />
            <asp:Parameter Name="Contact" Type="String" />
            <asp:Parameter Name="Street" Type="String" />
            <asp:Parameter Name="City" Type="String" />
            <asp:Parameter Name="Province" Type="String" />
            <asp:Parameter Name="Country" Type="String" />
            <asp:Parameter Name="Postcode" Type="String" />
            <asp:Parameter Name="Phone" Type="String" />
            <asp:Parameter Name="CellPhone" Type="String" />
            <asp:Parameter Name="IsDefault" Type="Boolean" />
            <asp:Parameter Name="CreateDate" Type="DateTime" />
        </InsertParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="odsAddressList" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="SelectByCompanyID" TypeName="SalePartial.BLL.XPDeliveryAddres">
        <SelectParameters>
            <asp:SessionParameter DbType="Guid" Name="CompanyID" SessionField="s_companyID_guid" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="odsVendorList" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="SelectDynamic" TypeName="SalePartial.BLL.XPCompany">
        <SelectParameters>
            <asp:Parameter DefaultValue="[VendorModerateStatus] = 1" Name="v_whereCondition"
                Type="String" />
            <asp:Parameter Name="v_orderByExpression" Type="String" DefaultValue="" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:XunPanConnectionString %>" 
        
        SelectCommand="SELECT * FROM [vw_XPFavoriteVendors] WHERE ([OwnerCompanyID] = @CompanyID)">
        <SelectParameters>
            <asp:SessionParameter Name="CompanyID" SessionField="s_companyID_guid" 
                Type="Object" />
        </SelectParameters>
    </asp:SqlDataSource>

    <%-- 黄宁修改，将[VendorModerateStatus] = 0改为‘1’--%>
    <asp:XmlDataSource ID="xdsWareCubes" runat="server" DataFile="~/App_Data/XML/Warecube.xml">
    </asp:XmlDataSource>
    <asp:XmlDataSource ID="xdsProcess" runat="server" DataFile="~/App_Data/XML/MfgProcess.xml">
    </asp:XmlDataSource>
    <asp:XmlDataSource ID="xdsProvinces" runat="server" DataFile="~/App_Data/XML/China_Provinces.xml">
    </asp:XmlDataSource>
    <asp:XmlDataSource ID="xdsCities" runat="server" DataFile="~/App_Data/XML/China_Cities.xml">
    </asp:XmlDataSource>

</asp:Content>
